package com.forstudy.controller;

import com.forstudy.common.bean.AjaxResponse;
import com.forstudy.common.bean.BaseController;
import com.forstudy.service.IDbService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: erdong
 * Date: 2020/4/15
 * Time: 16:51
 * Description: No Description
 */
@RequestMapping("/db")
@RestController
public class DbController extends BaseController {

    @Autowired
    private IDbService dbService;

    @PostMapping("/create")
    @ApiOperation(value = "创建集市表")
    public AjaxResponse createTable(HttpServletRequest request, String tableName, String fileId) {

        dbService.createTable(request, tableName, fileId);
        return new AjaxResponse();
    }
}
